-- tener en cuenta SOLO los artm con artm.modificastock='S'

CREATE OR REPLACE VIEW public.vstklote AS 
 SELECT artm.idart,
    artm.nrolote,
    artm.fechalote,
    sum(artm.signo::numeric * artm.cant) AS cant
   FROM artm
   WHERE artm.nrolote IS NOT NULL AND artm.modificastock = 'S'
   GROUP BY artm.idart, artm.nrolote, artm.fechalote;

ALTER TABLE public.vstklote OWNER TO abacouser;


-- =======================================
SELECT aaVersion('431.02','431.01');
-- =======================================